/**
 * @Author: Liu, Yunfeng
 * @DateTime: 2021/7/30 23:04
 * @Description: TODO
 */
public class titleToNumber {
    public static int titleToNumber(String columnTitle) {
        int result = 0;
        int length = columnTitle.length();
        int i = 1;
        while(length-i >= 0){
            result += (columnTitle.charAt(length-i)-64)*(int)Math.pow(26,i-1);
            i++;
        }
        return result;
    }

    public static void main(String[] args) {
        System.out.print(titleToNumber("FXSHRXW"));
    }
}
